﻿#ifndef FACADE_H
#define FACADE_H

#include "common/t_facade.h"
#include "head/g_functionbase.h"
#include "support/sp_env.h"
#include "m_fhs.h"
#include "itemedit.h"

namespace Ui {
class Facade;
}

class Facade : public TransFacade
{
    Q_OBJECT

public:
    explicit Facade(QWidget *parent = 0);
    ~Facade();

    void keyPressEvent(QKeyEvent *event);
    void mouseDoubleClickEvent(QMouseEvent *);
    void createMenu();
    void updateKeys();

    void createLocalStorage();
    bool db_try();
    void showItemEdit();
    void pop(const QString &label);

private:
    Ui::Facade *ui;

    QSqlDatabase db;
    QString userLand;
    QString table;

    ItemEdit *itemEdit;
    QMetaEnum keyType;
    QMap<QString,QString> keys;
    QMap<QString,QString> items;
};

#endif // FACADE_H
